package com.licode.codekit.db;

import java.util.ArrayList;
import java.util.List;

/**
 * 表结构定义
 *
 * @author licode
 */
public class Table {
    private String name;
    private String comment;

    /**
     * 主索引列
     */
    private Column primaryCol;
    private List<Column> columns = new ArrayList<>();

    @Override
    public String toString() {
        return name;
    }

    public Table() {

    }

    public Table(String name, String comment,
                 List<Column> columns) {
        this.name = name;
        this.comment = comment;
        this.columns = columns;
    }

    public String getName() {
        return name;
    }

    public String getComment() {
        return comment;
    }

    public Column getPrimaryCol() {
        return primaryCol;
    }

    public void setPrimaryCol(Column primaryCol) {
        this.primaryCol = primaryCol;
    }

    public List<Column> getColumns() {
        return columns;
    }

    public void setColumns(List<Column> columns) {
        this.columns = columns;
    }
}
